package kpi.javatraining6.gnatiuk.src.tester.user;

import java.util.List;

public class AdminController extends UserController{
	private List<User> users;
	public AdminController(User user,List<User> users) {
		super(user);
		this.users=users;
	}

	@Override
	protected void processCommand(UserCommands command) {
		showAllStatistics(command);
	}

	private void showAllStatistics(UserCommands command){
		if(command.equals(UserCommands.SHOW_STATS)){
			for (User user : users) {
                System.out.println(String.format("%s: %s",user.getUserName(), user.getStatistic()));
			}
		}else{
			help();
		}
	}
}